import {attestError} from '@/api/user.js'
export default{
	data() {
		return {
			isAttestErr: false,
			attestAginUrl: ''
		}
	},
	created() {
		this.getAttestErr()
	},
	methods: {
		getAttestErr() {
			attestError().then(res => {
				this.isAttestErr = res.data.isRealNameErrUser
				this.attestAginUrl = res.data.jumpLink
				// this.isAttestErr = true
			}).catch(err => console.log(err))
		},
		toAttestAgin() {
			if (this.attestAginUrl.indexOf('http') > -1) {
				const token = this.$store.state.collectionToken
				const url = `${this.attestAginUrl.split('#')[0]}?token=${token}#${this.attestAginUrl.split('#')[1]}`
				uni.navigateTo({
					url: `/pages/collection/otherPage?url=${url}`
				})
			} else {
				uni.navigateTo({
					url: this.attestAginUrl
				})
			}
		}
	}
}